#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <graphics (2).h>
#include <ege.h>
#include <stdlib.h>
#include <Windows.h>
#include <math.h>
#include <algorithm>

float angle_navigator = 0;
//mouse_msg mouse = getmouse();

void drawDisc(double x, double y, double r);					// 绘制圆盘
void drawchar(double X, double Y, double r);					// 绘制刻度字符
void drawline(double X, double Y, double r);					// 绘制圆周刻度
void drawshade(double X, double Y, double r);					// 表中间阴影
void drawchange(double X, double Y, double r);					// 改变中间的颜色
void drawcrossbot(double X, double Y, double r);				// 表中间十字_下层
void drawcrosstop(double X, double Y, double r);				// 表中间十字_下层
void drawtriangle(double X, double Y, double r);				// 黄色三角形
void drawredbox(double X, double Y, double r);					// 绘制红色框
void drawinchar(double X, double Y, double r);					// 打印表中字母
void drawKevencow(double X, double Y, double r);				// 绘制旋钮
void draw_navigator(double len_wigth, double x, double y);		// 整体的绘制
void rotatePoint(float x, float y, float centerX, float centerY, float an, float& x_new, float& y_new);		// 定义旋转函数

int main(void)
{
	for (int i = 0; i < 10; i++) {
		initgraph(900, 900, INIT_RENDERMANUAL);
		setbkcolor(EGEARGB(0XFF, 0x14, 0x14, 0x14));
		draw_navigator(800, 50, 50);  // 这里改位置和大小，第一个为大小，后两个为左上角坐标
	}

	return 0;
}

// 整体绘制
void draw_navigator(double len_width, double x, double y)
{
	// 抗锯齿
	ege_enable_aa(true);
	ege_setalpha(255);
	ege_enable_aa(true);
	ege_setalpha(255);

	float r = len_width / 2.0;
	float X = r + x;
	float Y = r + y;

	for (; is_run(); delay_fps(60)) {
		cleardevice();

		/*setfillcolor(EGERGB(255, 255, 255, 255));
		floodfillsurface(1, 1, EGERGB(20, 20, 20, 255));*/
		drawDisc(X, Y, r);			// 绘制圆盘
		drawchange(X, Y, r);		// 改变中间颜色
		drawcrossbot(X, Y, r);		// 表中间十字_下层
		drawredbox(X, Y, r);		// 绘制红色框
		drawinchar(X, Y, r);		// 打印表中字符
		drawshade(X, Y, r);			// 表中间阴影
		drawline(X, Y, r);			// 绘制圆周刻度
		drawchar(X, Y, r);			// 绘制刻度字符
		drawcrosstop(X, Y, r);		// 表中间十字_上层
		drawtriangle(X, Y, r);		// 黄色三角形
		drawKevencow(X, Y, r);		// 绘制旋钮

		int mousex, mousey;
		mousepos(&mousex, &mousey);
		if (GetAsyncKeyState(VK_LBUTTON) && 0x8000) {
			if (mousex > -(len_width / 11.6666666) + x && mousex < (len_width / 35.0) + x && mousey > len_width / 1.1475409836 + y && mousey < len_width / 0.9333333333 + y) {
				angle_navigator -= 1.0;
			}
			if (mousex > (len_width / 35.0) + x && mousex < (len_width / 7.0) + x && mousey > len_width / 1.1475409836 + y && mousey < len_width / 0.9333333333 + y) {
				angle_navigator += 1.0;
			}
		}

		setcolor(EGERGB(255, 255, 255));
		setfont(20, 10, "等线", 0, 0, 2000, false, false, false);
		xyprintf(0, 0, "FPS:%.3f", getfps());			//显示帧率
	}
}

// 绘制圆盘
void drawDisc(double x, double y, double r)			// x y为中心点坐标，r为半径
{
	setlinewidth(1);
	float edge = r * 2.0;

	// 绘制填充圆
	setfillcolor(EGERGB(10, 10, 10));// 设置圆盘边界颜色
	ege_fillellipse(x - r + edge / 700.0 * 2.5, y - r + edge / 700.0 * 2.5, r * 2.0 - edge / 700.0 * 5.0, r * 2.0 - edge / 700.0 * 5.0);// 绘制圆盘的外层

	// 绘制内圆环
	setcolor(EGERGB(60, 60, 60));// 设置圆盘边界颜色
	setlinewidth(2);// 设置圆盘边界宽度
	ege_ellipse(x - r + edge / 35.0, y - r + edge / 35.0, r * 2.0 - edge / 17.5, r * 2.0 - edge / 17.5);

	// 绘制外圆环
	setcolor(EGERGB(0, 0, 0));// 设置圆盘边界颜色
	setlinewidth(5);// 设置圆盘边界宽度
	ege_ellipse(x - r, y - r, r * 2.0, r * 2.0);
}

// 绘制圆周刻度
void drawline(double X, double Y, double r)
{
	float edge = r * 2.0;
	float x = X - r;
	float y = Y - r;

	setlinewidth(edge / 700.0 * 5.0);
	setcolor(EGERGB(170, 180, 200, 255));
	float newX1, newY1, newX2, newY2;
	float an, an2, an3;
	float angle = 0 + angle_navigator;
	float angle2 = 8 + angle_navigator;
	float angle3 = 0 + angle_navigator;
	int pos = 0;

	while (angle < 360 + angle_navigator) {
		an = angle * 3.1414926 / 180.0;
		rotatePoint(edge / 2.0 + x, edge / 7.7777777777 + y, edge / 2.0 + x, edge / 2.0 + y, an, newX1, newY1);
		rotatePoint(edge / 2.0 + x, edge / 5.6 + y, edge / 2.0 + x, edge / 2.0 + y, an, newX2, newY2);
		ege_line(newX1, newY1, newX2, newY2);

		if (angle < 360 + angle_navigator) {
			angle += 30;
		}
	}

	while (angle2 < 360 + angle_navigator) {
		an2 = angle2 * 3.1414926 / 180.0;
		rotatePoint(edge / 1.842105263 + x, edge / 6.18695652 + y, edge / 2.0 + x, edge / 2.0 + y, an2, newX1, newY1);
		rotatePoint(edge / 1.85185185 + x, edge / 5.6 + y, edge / 2.0 + x, edge / 2.0 + y, an2, newX2, newY2);
		ege_line(newX1, newY1, newX2, newY2);

		if (angle2 < 360 + angle_navigator) {
			angle2 += 10;
		}
	}

	while (angle3 < 360 + angle_navigator) {
		an3 = angle3 * 3.1414926 / 180.0;

		rotatePoint(edge / 2.0 + x, edge / 7.7777777777 / 0.88 + y, edge / 2.0 + x, edge / 2.0 + y, an3, newX1, newY1);
		rotatePoint(edge / 2.0 + x, edge / 5.6 + y, edge / 2.0 + x, edge / 2.0 + y, an3, newX2, newY2);
		ege_line(newX1, newY1, newX2, newY2);

		if (angle3 < 400 + angle_navigator) {
			angle3 += 10;
			pos++;
		}
	}
}

// 绘制刻度字符
void drawchar(double X, double Y, double r)
{
	setlinewidth(1);

	float edge = r * 2.0;
	float x = X - r;
	float y = Y - r;
	float angle = 0 + angle_navigator;
	float cX = edge / 2.0 + x, cY = edge / 2.0 + y;
	float x1 = edge / 2.0588235294 + x, y1 = edge / 12.8666666666 + y;
	float x1_new, y1_new;

	LOGFONTA f;
	getfont(&f);
	f.lfQuality = ANTIALIASED_QUALITY;
	setfont(&f);
	setbkmode(EGERGB(20, 20, 20, 255));
	float an = angle * 3.1414926 / 180.0;


	rotatePoint(x1, y1, cX, cY, an, x1_new, y1_new);
	setfont((edge / 7 / 3), (edge / 140 * 3), "等线", angle * -10.00, angle * -10.00, 2000, false, false, false);
	outtextxy((int)x1_new, (int)y1_new, "E");

	angle += 30.0;
	an = angle * 3.1414926 / 180.0;
	rotatePoint(x1 - edge / 700.0 * 5.0, y1, cX, cY, an, x1_new, y1_new);
	setfont((edge / 7 / 3), (edge / 140 * 3), "等线", angle * -10.00, angle * -10.00, 2000, false, false, false);
	outtextxy((int)x1_new, (int)y1_new, "12");

	angle += 30.0;
	an = angle * 3.1414926 / 180.0;
	rotatePoint(x1 - edge / 700.0 * 5.0, y1, cX, cY, an, x1_new, y1_new);
	setfont((edge / 7 / 3), (edge / 140 * 3), "等线", angle * -10.00, angle * -10.00, 2000, false, false, false);
	outtextxy((int)x1_new, (int)y1_new, "15");

	angle += 30.0;
	an = angle * 3.1414926 / 180.0;
	rotatePoint(x1, y1, cX, cY, an, x1_new, y1_new);
	setfont((edge / 7 / 3), (edge / 140 * 3), "等线", angle * -10.00, angle * -10.00, 2000, false, false, false);
	outtextxy((int)x1_new, (int)y1_new, "S");

	angle += 30.0;
	an = angle * 3.1414926 / 180.0;
	rotatePoint(x1 - edge / 700.0 * 5.0, y1, cX, cY, an, x1_new, y1_new);
	setfont((edge / 7 / 3), (edge / 140 * 3), "等线", angle * -10.00, angle * -10.00, 2000, false, false, false);
	outtextxy((int)x1_new, (int)y1_new, "21");

	angle += 30.0;
	an = angle * 3.1414926 / 180.0;
	rotatePoint(x1 - edge / 700.0 * 5.0, y1, cX, cY, an, x1_new, y1_new);
	setfont((edge / 7 / 3), (edge / 140 * 3), "等线", angle * -10.00, angle * -10.00, 2000, false, false, false);
	outtextxy((int)x1_new, (int)y1_new, "24");

	angle += 30.0;
	an = angle * 3.1414926 / 180.0;
	rotatePoint(x1 - edge / 700.0 * 5.0, y1, cX, cY, an, x1_new, y1_new);
	setfont((edge / 7 / 3), (edge / 140 * 3), "等线", angle * -10.00, angle * -10.00, 2000, false, false, false);
	outtextxy((int)x1_new, (int)y1_new, "W");

	angle += 30.0;
	an = angle * 3.1414926 / 180.0;
	rotatePoint(x1 - edge / 700.0 * 5.0, y1, cX, cY, an, x1_new, y1_new);
	setfont((edge / 7 / 3), (edge / 140 * 3), "等线", angle * -10.00, angle * -10.00, 2000, false, false, false);
	outtextxy((int)x1_new, (int)y1_new, "30");

	angle += 30.0;
	an = angle * 3.1414926 / 180.0;
	rotatePoint(x1 - edge / 700.0 * 5.0, y1, cX, cY, an, x1_new, y1_new);
	setfont((edge / 7 / 3), (edge / 140 * 3), "等线", angle * -10.00, angle * -10.00, 2000, false, false, false);
	outtextxy((int)x1_new, (int)y1_new, "33");

	angle += 30.0;
	an = angle * 3.1414926 / 180.0;
	rotatePoint(x1, y1, cX, cY, an, x1_new, y1_new);
	setfont((edge / 7 / 3), (edge / 140 * 3), "等线", angle * -10.00, angle * -10.00, 2000, false, false, false);
	outtextxy((int)x1_new, (int)y1_new, "N");

	angle += 30.0;
	an = angle * 3.1414926 / 180.0;
	rotatePoint(x1, y1, cX, cY, an, x1_new, y1_new);
	setfont((edge / 7 / 3), (edge / 140 * 3), "等线", angle * -10.00, angle * -10.00, 2000, false, false, false);
	outtextxy((int)x1_new, (int)y1_new, "3");

	angle += 30.0;
	an = angle * 3.1414926 / 180.0;
	rotatePoint(x1, y1, cX, cY, an, x1_new, y1_new);
	setfont((edge / 7 / 3), (edge / 140 * 3), "等线", angle * -10.00, angle * -10.00, 2000, false, false, false);
	outtextxy((int)x1_new, (int)y1_new, "6");
}

// 改变中间颜色
void drawchange(double X, double Y, double r)
{
	setlinewidth(1);

	float edge = r * 2.0;
	float x = X - r;
	float y = Y - r;

	setcolor(EGERGB(0, 0, 0, 255));
	ege_arc(edge / 5.6 + x, edge / 5.6 + y, edge - 2.0 * (edge / 5.6), edge - 2.0 * (edge / 5.6), 0, 360);

	setfillcolor(EGERGB(20, 20, 20, 255));
	floodfillsurface(edge / 2.0 + x, edge / 2.0 + y, EGERGB(10, 10, 10));
}

// 表中间阴影
void drawshade(double X, double Y, double r)
{
	float edge = r * 2.0;
	float x = X - r;
	float y = Y - r;

	setlinewidth(edge / 70.0 * 4.0);
	setcolor(EGEARGB(0x80, 0x10, 0x10, 0x10));
	ege_arc(edge / 5.0 + x, edge / 5.0 + y, edge - (2.0 * edge / 5.0), edge - (2.0 * edge / 5.0), 0, 360);
	setcolor(EGEARGB(0x70, 0x10, 0x10, 0x10));
	ege_arc(edge / 4.666666 + x, edge / 4.666666 + y, edge - (2.0 * edge / 4.666666), edge - (2.0 * edge / 4.666666), 0, 360);
	setcolor(EGEARGB(0x60, 0x10, 0x10, 0x10));
	ege_arc(edge / 4.375 + x, edge / 4.375 + y, edge - (2.0 * edge / 4.375), edge - (2.0 * edge / 4.375), 0, 360);
	setcolor(EGEARGB(0x50, 0x10, 0x10, 0x10));
	ege_arc(edge / 4.1176470588 + x, edge / 4.1176470588 + y, edge - (2.0 * edge / 4.1176470588), edge - (2.0 * edge / 4.1176470588), 0, 360);
	setcolor(EGEARGB(0x40, 0x10, 0x10, 0x10));
	ege_arc(edge / 3.8888888 + x, edge / 3.8888888 + y, edge - (2.0 * edge / 3.8888888), edge - (2.0 * edge / 3.8888888), 0, 360);
	setcolor(EGEARGB(0x30, 0x10, 0x10, 0x10));
	ege_arc(edge / 3.6842105263 + x, edge / 3.6842105263 + y, edge - (2.0 * edge / 3.6842105263), edge - (2.0 * edge / 3.6842105263), 0, 360);
	setcolor(EGEARGB(0x30, 0x10, 0x10, 0x10));
	ege_arc(edge / 3.5 + x, edge / 3.5 + y, edge - (2.0 * edge / 3.5), edge - (2.0 * edge / 3.5), 0, 360);
}

// 表中间十字_上层
void drawcrosstop(double X, double Y, double r)
{
	float edge = r * 2.0;
	float x = X - r;
	float y = Y - r;

	setlinewidth(edge / 700.0 * 8.0);
	setcolor(EGERGB(170, 180, 200, 255));	// 上层白线
	ege_line(edge / 2.0 + x, edge / 3.6842105263 + y, edge / 2.0 + x, edge / 1.372549 + y);
	ege_line(edge / 3.6842105263 + x, edge / 2.0 + y, edge / 1.372549 + x, edge / 2.0 + y);
}

// 表中间十字_下层
void drawcrossbot(double X, double Y, double r)
{
	float edge = r * 2.0;
	float x = X - r;
	float y = Y - r;

	setlinewidth(edge / 700.0 * 50.0);		// 底部阴影
	setcolor(EGEARGB(0x90, 10, 10, 10));
	ege_line(edge / 2.0 + x, edge / 4.66666666 + y, edge / 2.0 + x, edge / 1.2727272727 + y);
	ege_line(edge / 4.66666666 + x, edge / 2.0 + y, edge / 1.2727272727 + x, edge / 2.0 + y);

	setlinewidth(edge / 700.0 * 40.0);		// 下侧立体线
	setcolor(EGERGB(55, 55, 65, 255));
	ege_line(edge / 2.0 + x, edge / 4.66666666 + y, edge / 2.0 + x, edge / 1.2727272727 + y);
	ege_line(edge / 4.66666666 + x, edge / 2.0 + y, edge / 1.2727272727 + x, edge / 2.0 + y);

	setlinewidth(edge / 700.0 * 20.0);		// 中间的黑线
	setcolor(EGERGB(10, 10, 10, 255));
	ege_line(edge / 2.0 + x, edge / 4.66666666 + y, edge / 2.0 + x, edge / 1.2727272727 + y);
	ege_line(edge / 4.66666666 + x, edge / 2.0 + y, edge / 1.2727272727 + x, edge / 2.0 + y);

	float dis = edge / 70.0 * 3.0;			// 小白线
	setlinewidth(edge / 700.0 * 3.0);
	for (int i = 0; i < 5; i++) {
		setcolor(EGEARGB(255 - i * 10, 0xaa, 0xb4, 0xc8));
		ege_line(edge / 2.0895522388 + x, edge / 2.2222222 + y - dis * (float)i, edge / 1.917808219 + x, edge / 2.2222222 + y - dis * (float)i);
		ege_line(edge / 2.0895522388 + x, edge / 1.81818181818 + y + dis * (float)i, edge / 1.917808219 + x, edge / 1.81818181818 + y + dis * (float)i);
		ege_line(edge / 2.2222222 + x - dis * (float)i, edge / 2.0895522388 + y, edge / 2.2222222 + x - dis * (float)i, edge / 1.917808219 + y);
		ege_line(edge / 1.81818181818 + x + dis * (float)i, edge / 2.0895522388 + y, edge / 1.81818181818 + x + dis * (float)i, edge / 1.917808219 + y);
	}

	setlinewidth(edge / 700.0 * 8.0);		// 中间白色小圆
	setfillcolor(EGERGB(120, 130, 165, 255));
	ege_fillellipse(edge / 2.0895522388 + x, edge / 2.0895522388 + y, edge - 2.0 * (edge / 2.0895522388), edge - 2.0 * (edge / 2.0895522388));

	setlinewidth(edge / 700.0 * 2.0);
	ege_line(edge / 2.0588235294 + x, edge / 2.0588235294 + y, edge / 1.94444444 + x, edge / 1.94444444 + y);
	ege_line(edge / 1.94444444 + x, edge / 2.0588235294 + y, edge / 2.0588235294 + x, edge / 1.94444444 + y);
}

// 黄色三角形
void drawtriangle(double X, double Y, double r)
{
	float edge = r * 2.0;
	float x = X - r;
	float y = Y - r;

	setfillcolor(EGERGB(120, 110, 0, 255));
	ege_point points[] = { {edge / 2.0 + x, edge / 5.185185185185 + y}, {edge / 2.153846153846 + x, edge / 4.0 + y}, {edge / 1.8666666666 + x, edge / 4.0 + y} };
	ege_fillpoly(3, points);
	ege_point points2[] = { {edge / 2.0 + x, edge / 1.238938053 + y}, {edge / 2.0895522388 + x, edge / 1.3084112 + y}, {edge / 1.917808219 + x, edge / 1.3084112 + y} };
	ege_fillpoly(3, points2);
}

// 绘制红色框
void drawredbox(double X, double Y, double r)
{
	float edge = r * 2.0;
	float x = X - r;
	float y = Y - r;

	setfillcolor(EGERGB(90, 20, 20, 255));
	ege_point point1[] = { {edge / 3.41463414634 + x, edge / 2.54545454545 + y}, {edge / 2.59259259259 + x, edge / 2.54545454545 + y}, {edge / 2.59259259259 + x, edge / 2.258064516 + y}, {edge / 3.41463414634 + x, edge / 2.258064516 + y} };
	ege_fillpoly(4, point1);
	ege_point point2[] = { {edge / 1.79487179487 + x, edge / 4.0 + y}, {edge / 1.68674698795 + x, edge / 4.0 + y}, {edge / 1.68674698795 + x, edge / 2.4137931 + y}, {edge / 1.79487179487 + x, edge / 2.4137931 + y} };
	ege_fillpoly(4, point2);
}

// 打印表中字母
void drawinchar(double X, double Y, double r)
{
	float edge = r * 2.0;
	float x = X - r;
	float y = Y - r;

	setcolor(EGERGB(0, 0, 0, 255));
	setfont(edge / 70 * 3, 0, "等线", 0, 0, 2000, false, false, false);
	outtextxy(edge / 3.18181818 + x, edge / 2.5 + y, "GS");
	outtextxy(edge / 1.7902813299 + x, edge / 3.88888888 + y, "N");
	outtextxy(edge / 1.7857142857 + x, edge / 3.381642512 + y, "A");
	outtextxy(edge / 1.7857142857 + x, edge / 2.9787234 + y, "V");
	outtextxy(edge / 1.776649746 + x, edge / 2.6923076923 + y, "2");
	setcolor(EGERGB(170, 180, 200, 255));
	outtextxy(edge / 1.6091954 + x, edge / 3.11111111111 + y, "T 0");
	outtextxy(edge / 1.6091954 + x, edge / 1.47368421 - edge / 70.0 * 3.0 + y, "F R");
}

// 绘制旋钮
void drawKevencow(double X, double Y, double r)
{
	float edge = r * 2.0;
	float x = X - r;
	float y = Y - r;
	float cX = edge / 35.0 + x, cY = edge / 1.0294117647 + y, x1_new, y1_new, x2_new, y2_new;
	float an;

	setlinewidth(edge / 140);
	setcolor(EGERGB(40, 40, 40, 255));
	ege_arc(-edge / 15.5555555 + x, edge / 1.138211382 + y, edge / 5.3846153846, edge / 5.3846153846, 0, 360);
	setlinewidth(edge / 140 * 3);
	setcolor(EGERGB(17, 18, 20, 255));
	ege_arc(-edge / 20.0 + x, edge / 1.12 + y, edge / 6.363636363636, edge / 6.363636363636, 0, 360);
	setfillcolor(EGERGB(50, 55, 65, 255));
	floodfillsurface(edge / 35.0 + x, edge / 1.0294117647 + y, EGERGB(20, 20, 20, 255));

	setlinewidth(edge / 175 * 2);
	setcolor(EGEARGB(100, 0x64, 0x69, 0x6e));
	float x1 = -edge / 23.333333333 + x, y1 = edge / 1.11111111 + y, x2 = edge / 10.0 + x, y2 = edge / 0.9589041 + y;
	ege_line(x1, y1, x2, y2);
	an = 5 * 3.1414926 / 180.0;
	rotatePoint(x1, y1, cX, cY, an, x1_new, y1_new);
	rotatePoint(x2, y2, cX, cY, an, x2_new, y2_new);
	ege_line(x1_new, y1_new, x2_new, y2_new);
	ege_line(x1_new, y1_new, x2_new, y2_new);
	an = 10 * 3.1414926 / 180.0;
	rotatePoint(x1, y1, cX, cY, an, x1_new, y1_new);
	rotatePoint(x2, y2, cX, cY, an, x2_new, y2_new);
	ege_line(x1_new, y1_new, x2_new, y2_new);
	ege_line(x1_new, y1_new, x2_new, y2_new);
	an = 15 * 3.1414926 / 180.0;
	rotatePoint(x1, y1, cX, cY, an, x1_new, y1_new);
	rotatePoint(x2, y2, cX, cY, an, x2_new, y2_new);
	ege_line(x1_new, y1_new, x2_new, y2_new);
	ege_line(x1_new, y1_new, x2_new, y2_new);
	x1 = edge / 10.0 + x, y1 = edge / 1.11111111 + y, x2 = -edge / 23.333333333 + x, y2 = edge / 0.9589041 + y;
	ege_line(x1, y1, x2, y2);
	an = -5 * 3.1414926 / 180.0;
	rotatePoint(x1, y1, cX, cY, an, x1_new, y1_new);
	rotatePoint(x2, y2, cX, cY, an, x2_new, y2_new);
	ege_line(x1_new, y1_new, x2_new, y2_new);
	ege_line(x1_new, y1_new, x2_new, y2_new);
	an = -10 * 3.1414926 / 180.0;
	rotatePoint(x1, y1, cX, cY, an, x1_new, y1_new);
	rotatePoint(x2, y2, cX, cY, an, x2_new, y2_new);
	ege_line(x1_new, y1_new, x2_new, y2_new);
	ege_line(x1_new, y1_new, x2_new, y2_new);
	an = -15 * 3.1414926 / 180.0;
	rotatePoint(x1, y1, cX, cY, an, x1_new, y1_new);
	rotatePoint(x2, y2, cX, cY, an, x2_new, y2_new);
	ege_line(x1_new, y1_new, x2_new, y2_new);
	ege_line(x1_new, y1_new, x2_new, y2_new);

	setlinewidth(edge / 140 * 3);
	setcolor(EGERGB(13, 13, 13, 255));
	ege_arc(-edge / 12.727272727 + x, edge / 1.15702479 + y, edge / 4.66666666, edge / 4.66666666, 0, 360);

	setlinewidth(edge / 700 * 3);
	setcolor(EGERGB(0, 0, 0, 255));
	ege_arc(-edge / 11.66666666 + x, edge / 1.16666666 + y, edge / 4.375, edge / 4.375, 0, 360);
}

// 旋转线段
void rotatePoint(float x, float y, float centerX, float centerY, float an, float& x_new, float& y_new)
{
	x_new = centerX + (x - centerX) * cos(an) - (y - centerY) * sin(an);
	y_new = centerY + (x - centerX) * sin(an) + (y - centerY) * cos(an);
}